import openpyxl


class FileData:

    def __init__(self):
        self.wb = openpyxl.load_workbook("F:/pythonDemo/ddtDemo/test.xlsx")
        self.sheet1 = self.wb[self.wb.sheetnames[0]]

    def get_query_data(self):

        dataList = []

        for i in range(1, self.sheet1.max_row):
            dataMap = {}

            for j in range(1, self.sheet1.max_column+1):
                dataMap[self.sheet1.cell(row=1, column=j).value] = self.sheet1.cell(row=i+1, column=j).value

            dataList.append(dataMap)

        return dataList

# if __name__ == '__main__':
#     print(FileData().get_query_data())